<template>
  <div>
    <My-son></My-son>
    <!-- 
        provide,inject
        provide 向所有的后代注入参数，它的后代可以通过inject接收
     -->
  </div>
</template>

<script>
import MySon from "../components/MySon.vue";
export default {
  data() {
    return {
        tit:"张三"
    };
  },
  components: {
    MySon,
  },
  provide(){
    return{
        // title:this.tit,
        //默认是非响应式的
        title:()=>{
            return this.tit
        }
    }
  }
};
</script>

<style>
</style>